package com.ccy.springboot149.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ccy.springboot149.dao.UsersDao;
import com.ccy.springboot149.entity.UsersEntity;
import com.ccy.springboot149.service.UsersService;
import com.ccy.springboot149.utils.PageUtils;
import com.ccy.springboot149.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Author : CaiYang
 * @Date : 2025-07-02 23:16
 * @Description :
 */
@Service("userServer")
public class UsersServiceImpl extends ServiceImpl<UsersDao, UsersEntity> implements UsersService {

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper wrapper) {
        Page<UsersEntity> page = new Query<UsersEntity>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }

    @Override
    public List<UsersEntity> selectListView(EntityWrapper<UsersEntity> ew) {
        return baseMapper.selectListView(ew);
    }
}
